import { INIT_LIST_ACTION } from './actionTypes';
import axios from 'axios';

export const initListAction = (data: any) => {
  return {
    type: INIT_LIST_ACTION,
    data,
  };
};

export const getTodoList = () => {
  return async (dispatch: any) => {
    const {
      data: { result },
    } = await axios.get('/gold/shgold?key=b429ba39d14a30326c2ab6d985e48ee9');
    const action = initListAction(result);
    dispatch(action);
  };
};
